<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.util.Locale"%>
<%@page import="java.util.ResourceBundle"%>
<%@page import="com.google.appengine.api.users.User"%>
<%@page import="com.google.appengine.api.users.UserServiceFactory"%>
<%@page import="com.google.appengine.api.users.UserService"%>  
<%	
	ResourceBundle resource = ResourceBundle.getBundle("config", new Locale("vi"));
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>  
	<meta http-equiv="content-type" content="text/html;charset=UTF-8">
	<title><%=request.getParameter("title") %></title>	
	<!-- 	<base href="http://www.tubeonfire.com/" /> -->
	<meta name="description" content="<%=request.getParameter("description")%>">
	<meta name="keywords" content="<%= request.getParameter("key")%>">
	<meta property="og:site_name" content=<%=request.getParameter("site_name") %>/>
	<meta property="og:title" content="<%=request.getParameter("title")%>"/>
	<meta property="og:url" content="<%=request.getParameter("url")%>"/>
	<meta property="og:image" content="<%=request.getParameter("images")%>"/> 	
	<meta property="og:description" content="<%=request.getParameter("description")%>"/>
		
	<!-- CSS -->
	<link rel="stylesheet" type="text/css" href="/css/main.css" media="screen" />
	<link id="preview-change-color" rel="stylesheet" type="text/css" href="/css/phpvibe.css" media="screen" />
	<link rel="stylesheet" href="/css/jquery.lightbox.css"/>
	<link rel="stylesheet" href="/css/buttons.css" type="text/css"/>
	<link rel="stylesheet" href="/css/960_fluid.css" />
	<link rel="stylesheet" href="/css/main_style.css" />
	<link rel="stylesheet" href="/css/bar_nav.css" />
	<link rel="stylesheet" href="/css/theme_red.css" />
	<link rel="stylesheet" href="/css/comments.css" />	
		
	<!-- Header Js -->
	<script type="text/javascript" src="/js/jquery.min.js"></script>	
	<script type="text/javascript" src="/js/jquery.eislideshow.js"></script>		
	<script type="text/javascript">
	           jQuery(function() {
	                $('#ei-slider').eislideshow({
						animation			: 'center',
						autoplay			: true,
						slideshow_interval	: 5000,
						titlesFactor		: 0
	                });				
					
	            });
	  
	</script>			
	<script type="text/javascript" src="/js/jquery-ui.min.js"></script>
	<script type="text/javascript" src="/js/hoverIntent.js"></script>
	<script type="text/javascript" src="/js/jquery.googleSuggest.js"></script>
	<script type="text/javascript" src="/js/l10na17a.js"></script>
	<script type="text/javascript" src="/js/modernizr-2.0.6deae.js"></script>	
	<!--[if IE]>
	<script src="http://videoinedit.com/tpl/js/html5.js"></script>
	<![endif]-->
	<script type="text/javascript" src="/js/comment.js"></script>
	<script type="text/javascript" src="/js/jquery.lightbox.js"></script>	
	<script type="text/javascript">	
	  var _gaq = _gaq || [];
	  _gaq.push(['_setAccount', 'UA-15012644-5']);
	  _gaq.push(['_setDomainName', '<%=resource.getString("site_link")%>']);
	  _gaq.push(['_trackPageview']);
	
	  (function() {
	    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
	    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
	  })();	
	</script>		
</head>  
<body>  
<%
	UserService userService = UserServiceFactory.getUserService();
	User user = userService.getCurrentUser();
	if(user!=null){
%>
	<div id="topNav">
	    <div class="fixed" style="background: black;">
	        <div class="wrapper">           
	            <div class="userNav">
	                <ul>     
	                	<li>
	                		<span>Welcome : <strong><%=user.getNickname() %></strong></span>
	                	</li>  
	               	  <li><a href="/"><img src="/images/tasks.png" alt=""><span>My Categories</span></a>
	                    	<ul class="menu_body" style="display: none; ">
	                            <li><a href="/admin/category/create" title="">New Category</a></li>
	                            <li><a href="/admin/category/manager" title="">Manager</a></li>                            
	                        </ul>
	                    </li>				         	                                        	
	                    <li>
	                    	<a href="<%=userService.createLogoutURL("/home") %>" title="">
	                    		<img src="/images/logout.png" alt="">
	                    		<span>Logout</span>
                    		</a>	                    
	                    </li>
	                </ul>
	            </div>
	            <div class="fix"></div>
	        </div>
	    </div>
	</div>
<%
	}
%>

<header id="main-header" class="whitex clearfix">
	<div id="header-container">
	   	<div id="logo">
	   		<a href="/">
	   			<img src="/images/logo.png" title="<%=resource.getString("site_title") %>" alt="<%=resource.getString("site_title") %>" style="height: 32px; margin-top: 13px"/>
   			</a> 
	   	</div>
   	<%
		if(user!=null){
	%>
		<div id="main-search">
			<div class="searchWidget">
             	<form action="" method="get" id="searchform" onsubmit="location.href='/search/' + encodeURIComponent(this.tag.value).replace(/%20/g, '+'); return false;">
            	<input type="text" name="tag" id="suggest-youtube" value="to search videos, type and hit enter" onfocus="if (this.value == 'to search videos, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'to search videos, type and hit enter';}" />
                      <input type="submit" name="find" value="" />
                  </form>
              </div>
		</div>		
		<%
		}
		%>
	</div>
 </header>